3.3.27 \(\int \frac {(g+h x)^2 (d+e x+f x^2)}{\sqrt {a+b x+c x^2}} \, dx\) [227]

3.3.27.1 Optimal result
3.3.27.2 Mathematica [A] (verified)
3.3.27.3 Rubi [A] (verified)
3.3.27.4 Maple [A] (verified)
3.3.27.5 Fricas [A] (verification not implemented)
3.3.27.6 Sympy [B] (verification not implemented)
3.3.27.7 Maxima [F(-2)]
3.3.27.8 Giac [A] (verification not implemented)
3.3.27.9 Mupad [F(-1)]

3.3.27.1 Optimal result

Integrand size = 32, antiderivative size = 420 \[ \int \frac {(g+h x)^2 \left (d+e x+f x^2\right )}{\sqrt {a+b x+c x^2}} \, dx=-\frac {(2 c f g-8 c e h+7 b f h) (g+h x)^2 \sqrt {a+b x+c x^2}}{24 c^2 h}+\frac {f (g+h x)^3 \sqrt {a+b x+c x^2}}{4 c h}-\frac {\left (105 b^3 f h^3+32 c^3 g \left (f g^2-4 h (e g+3 d h)\right )-20 b c h^2 (11 a f h+6 b (2 f g+e h))+8 c^2 h \left (16 a h (2 f g+e h)+b \left (11 f g^2+18 h (2 e g+d h)\right )\right )-2 c h \left (35 b^2 f h^2-4 c h (6 b f g+10 b e h+9 a f h)-8 c^2 \left (f g^2-2 h (2 e g+3 d h)\right )\right ) x\right ) \sqrt {a+b x+c x^2}}{192 c^4 h}+\frac {\left (128 c^4 d g^2+35 b^4 f h^2-40 b^2 c h (2 b f g+b e h+3 a f h)-64 c^3 \left (b g (e g+2 d h)+a \left (f g^2+2 e g h+d h^2\right )\right )+48 c^2 \left (a^2 f h^2+2 a b h (2 f g+e h)+b^2 \left (f g^2+2 e g h+d h^2\right )\right )\right ) \text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{128 c^{9/2}} \]

output
1/128*(128*c^4*d*g^2+35*b^4*f*h^2-40*b^2*c*h*(3*a*f*h+b*e*h+2*b*f*g)-64*c^ 
3*(b*g*(2*d*h+e*g)+a*(d*h^2+2*e*g*h+f*g^2))+48*c^2*(a^2*f*h^2+2*a*b*h*(e*h 
+2*f*g)+b^2*(d*h^2+2*e*g*h+f*g^2)))*arctanh(1/2*(2*c*x+b)/c^(1/2)/(c*x^2+b 
*x+a)^(1/2))/c^(9/2)-1/24*(7*b*f*h-8*c*e*h+2*c*f*g)*(h*x+g)^2*(c*x^2+b*x+a 
)^(1/2)/c^2/h+1/4*f*(h*x+g)^3*(c*x^2+b*x+a)^(1/2)/c/h-1/192*(105*b^3*f*h^3 
+32*c^3*g*(f*g^2-4*h*(3*d*h+e*g))-20*b*c*h^2*(11*a*f*h+6*b*(e*h+2*f*g))+8* 
c^2*h*(16*a*h*(e*h+2*f*g)+b*(11*f*g^2+18*h*(d*h+2*e*g)))-2*c*h*(35*b^2*f*h 
^2-4*c*h*(9*a*f*h+10*b*e*h+6*b*f*g)-8*c^2*(f*g^2-2*h*(3*d*h+2*e*g)))*x)*(c 
*x^2+b*x+a)^(1/2)/c^4/h
 
3.3.27.2 Mathematica [A] (verified)

Time = 1.26 (sec) , antiderivative size = 341, normalized size of antiderivative = 0.81 \[ \int \frac {(g+h x)^2 \left (d+e x+f x^2\right )}{\sqrt {a+b x+c x^2}} \, dx=\frac {2 \sqrt {c} \sqrt {a+x (b+c x)} \left (-105 b^3 f h^2+10 b c h (22 a f h+b (24 f g+12 e h+7 f h x))+16 c^3 \left (6 d h (4 g+h x)+4 e \left (3 g^2+3 g h x+h^2 x^2\right )+f x \left (6 g^2+8 g h x+3 h^2 x^2\right )\right )-8 c^2 \left (2 b h (18 e g+9 d h+5 e h x)+a h (32 f g+16 e h+9 f h x)+b f \left (18 g^2+20 g h x+7 h^2 x^2\right )\right )\right )+3 \left (-128 c^4 d g^2-35 b^4 f h^2+40 b^2 c h (2 b f g+b e h+3 a f h)+64 c^3 \left (a f g^2+a h (2 e g+d h)+b g (e g+2 d h)\right )-48 c^2 \left (a^2 f h^2+2 a b h (2 f g+e h)+b^2 \left (f g^2+h (2 e g+d h)\right )\right )\right ) \log \left (b+2 c x-2 \sqrt {c} \sqrt {a+x (b+c x)}\right )}{384 c^{9/2}} \]

input
Integrate[((g + h*x)^2*(d + e*x + f*x^2))/Sqrt[a + b*x + c*x^2],x]
 
output
(2*Sqrt[c]*Sqrt[a + x*(b + c*x)]*(-105*b^3*f*h^2 + 10*b*c*h*(22*a*f*h + b* 
(24*f*g + 12*e*h + 7*f*h*x)) + 16*c^3*(6*d*h*(4*g + h*x) + 4*e*(3*g^2 + 3* 
g*h*x + h^2*x^2) + f*x*(6*g^2 + 8*g*h*x + 3*h^2*x^2)) - 8*c^2*(2*b*h*(18*e 
*g + 9*d*h + 5*e*h*x) + a*h*(32*f*g + 16*e*h + 9*f*h*x) + b*f*(18*g^2 + 20 
*g*h*x + 7*h^2*x^2))) + 3*(-128*c^4*d*g^2 - 35*b^4*f*h^2 + 40*b^2*c*h*(2*b 
*f*g + b*e*h + 3*a*f*h) + 64*c^3*(a*f*g^2 + a*h*(2*e*g + d*h) + b*g*(e*g + 
 2*d*h)) - 48*c^2*(a^2*f*h^2 + 2*a*b*h*(2*f*g + e*h) + b^2*(f*g^2 + h*(2*e 
*g + d*h))))*Log[b + 2*c*x - 2*Sqrt[c]*Sqrt[a + x*(b + c*x)]])/(384*c^(9/2 
))
 
3.3.27.3 Rubi [A] (verified)

Time = 0.99 (sec) , antiderivative size = 432, normalized size of antiderivative = 1.03, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.219, Rules used = {2184, 27, 1236, 27, 1225, 1092, 219}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {(g+h x)^2 \left (d+e x+f x^2\right )}{\sqrt {a+b x+c x^2}} \, dx\)

\(\Big \downarrow \) 2184

\(\displaystyle \frac {\int -\frac {h (g+h x)^2 (b f g-8 c d h+6 a f h+(2 c f g-8 c e h+7 b f h) x)}{2 \sqrt {c x^2+b x+a}}dx}{4 c h^2}+\frac {f (g+h x)^3 \sqrt {a+b x+c x^2}}{4 c h}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {f (g+h x)^3 \sqrt {a+b x+c x^2}}{4 c h}-\frac {\int \frac {(g+h x)^2 (b f g-8 c d h+6 a f h+(2 c f g-8 c e h+7 b f h) x)}{\sqrt {c x^2+b x+a}}dx}{8 c h}\)

\(\Big \downarrow \) 1236

\(\displaystyle \frac {f (g+h x)^3 \sqrt {a+b x+c x^2}}{4 c h}-\frac {\frac {\int -\frac {(g+h x) \left (7 f g h b^2+4 \left (7 a f h^2-c g (f g+2 e h)\right ) b+4 c h (12 c d g-7 a f g-8 a e h)+\left (-8 \left (f g^2-2 h (2 e g+3 d h)\right ) c^2-4 h (6 b f g+10 b e h+9 a f h) c+35 b^2 f h^2\right ) x\right )}{2 \sqrt {c x^2+b x+a}}dx}{3 c}+\frac {(g+h x)^2 \sqrt {a+b x+c x^2} (7 b f h-8 c e h+2 c f g)}{3 c}}{8 c h}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {f (g+h x)^3 \sqrt {a+b x+c x^2}}{4 c h}-\frac {\frac {(g+h x)^2 \sqrt {a+b x+c x^2} (7 b f h-8 c e h+2 c f g)}{3 c}-\frac {\int \frac {(g+h x) \left (7 f g h b^2+28 a f h^2 b-4 c g (f g+2 e h) b+4 c h (12 c d g-7 a f g-8 a e h)+\left (-8 \left (f g^2-2 h (2 e g+3 d h)\right ) c^2-4 h (6 b f g+10 b e h+9 a f h) c+35 b^2 f h^2\right ) x\right )}{\sqrt {c x^2+b x+a}}dx}{6 c}}{8 c h}\)

\(\Big \downarrow \) 1225

\(\displaystyle \frac {f (g+h x)^3 \sqrt {a+b x+c x^2}}{4 c h}-\frac {\frac {(g+h x)^2 \sqrt {a+b x+c x^2} (7 b f h-8 c e h+2 c f g)}{3 c}-\frac {\frac {3 h \left (48 c^2 \left (a^2 f h^2+2 a b h (e h+2 f g)+b^2 \left (h (d h+2 e g)+f g^2\right )\right )-40 b^2 c h (3 a f h+b e h+2 b f g)-64 c^3 \left (a h (d h+2 e g)+a f g^2+b g (2 d h+e g)\right )+35 b^4 f h^2+128 c^4 d g^2\right ) \int \frac {1}{\sqrt {c x^2+b x+a}}dx}{8 c^2}-\frac {\sqrt {a+b x+c x^2} \left (-2 c h x \left (-4 c h (9 a f h+10 b e h+6 b f g)+35 b^2 f h^2-8 c^2 \left (f g^2-2 h (3 d h+2 e g)\right )\right )+8 c^2 h \left (16 a h (e h+2 f g)+18 b h (d h+2 e g)+11 b f g^2\right )-20 b c h^2 (11 a f h+6 b (e h+2 f g))+105 b^3 f h^3+32 c^3 \left (f g^3-4 g h (3 d h+e g)\right )\right )}{4 c^2}}{6 c}}{8 c h}\)

\(\Big \downarrow \) 1092

\(\displaystyle \frac {f (g+h x)^3 \sqrt {a+b x+c x^2}}{4 c h}-\frac {\frac {(g+h x)^2 \sqrt {a+b x+c x^2} (7 b f h-8 c e h+2 c f g)}{3 c}-\frac {\frac {3 h \left (48 c^2 \left (a^2 f h^2+2 a b h (e h+2 f g)+b^2 \left (h (d h+2 e g)+f g^2\right )\right )-40 b^2 c h (3 a f h+b e h+2 b f g)-64 c^3 \left (a h (d h+2 e g)+a f g^2+b g (2 d h+e g)\right )+35 b^4 f h^2+128 c^4 d g^2\right ) \int \frac {1}{4 c-\frac {(b+2 c x)^2}{c x^2+b x+a}}d\frac {b+2 c x}{\sqrt {c x^2+b x+a}}}{4 c^2}-\frac {\sqrt {a+b x+c x^2} \left (-2 c h x \left (-4 c h (9 a f h+10 b e h+6 b f g)+35 b^2 f h^2-8 c^2 \left (f g^2-2 h (3 d h+2 e g)\right )\right )+8 c^2 h \left (16 a h (e h+2 f g)+18 b h (d h+2 e g)+11 b f g^2\right )-20 b c h^2 (11 a f h+6 b (e h+2 f g))+105 b^3 f h^3+32 c^3 \left (f g^3-4 g h (3 d h+e g)\right )\right )}{4 c^2}}{6 c}}{8 c h}\)

\(\Big \downarrow \) 219

\(\displaystyle \frac {f (g+h x)^3 \sqrt {a+b x+c x^2}}{4 c h}-\frac {\frac {(g+h x)^2 \sqrt {a+b x+c x^2} (7 b f h-8 c e h+2 c f g)}{3 c}-\frac {\frac {3 h \text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right ) \left (48 c^2 \left (a^2 f h^2+2 a b h (e h+2 f g)+b^2 \left (h (d h+2 e g)+f g^2\right )\right )-40 b^2 c h (3 a f h+b e h+2 b f g)-64 c^3 \left (a h (d h+2 e g)+a f g^2+b g (2 d h+e g)\right )+35 b^4 f h^2+128 c^4 d g^2\right )}{8 c^{5/2}}-\frac {\sqrt {a+b x+c x^2} \left (-2 c h x \left (-4 c h (9 a f h+10 b e h+6 b f g)+35 b^2 f h^2-8 c^2 \left (f g^2-2 h (3 d h+2 e g)\right )\right )+8 c^2 h \left (16 a h (e h+2 f g)+18 b h (d h+2 e g)+11 b f g^2\right )-20 b c h^2 (11 a f h+6 b (e h+2 f g))+105 b^3 f h^3+32 c^3 \left (f g^3-4 g h (3 d h+e g)\right )\right )}{4 c^2}}{6 c}}{8 c h}\)

input
Int[((g + h*x)^2*(d + e*x + f*x^2))/Sqrt[a + b*x + c*x^2],x]
 
output
(f*(g + h*x)^3*Sqrt[a + b*x + c*x^2])/(4*c*h) - (((2*c*f*g - 8*c*e*h + 7*b 
*f*h)*(g + h*x)^2*Sqrt[a + b*x + c*x^2])/(3*c) - (-1/4*((105*b^3*f*h^3 + 3 
2*c^3*(f*g^3 - 4*g*h*(e*g + 3*d*h)) - 20*b*c*h^2*(11*a*f*h + 6*b*(2*f*g + 
e*h)) + 8*c^2*h*(11*b*f*g^2 + 18*b*h*(2*e*g + d*h) + 16*a*h*(2*f*g + e*h)) 
 - 2*c*h*(35*b^2*f*h^2 - 4*c*h*(6*b*f*g + 10*b*e*h + 9*a*f*h) - 8*c^2*(f*g 
^2 - 2*h*(2*e*g + 3*d*h)))*x)*Sqrt[a + b*x + c*x^2])/c^2 + (3*h*(128*c^4*d 
*g^2 + 35*b^4*f*h^2 - 40*b^2*c*h*(2*b*f*g + b*e*h + 3*a*f*h) - 64*c^3*(a*f 
*g^2 + a*h*(2*e*g + d*h) + b*g*(e*g + 2*d*h)) + 48*c^2*(a^2*f*h^2 + 2*a*b* 
h*(2*f*g + e*h) + b^2*(f*g^2 + h*(2*e*g + d*h))))*ArcTanh[(b + 2*c*x)/(2*S 
qrt[c]*Sqrt[a + b*x + c*x^2])])/(8*c^(5/2)))/(6*c))/(8*c*h)
 

3.3.27.3.1 Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 1092
Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Simp[2   Subst[I 
nt[1/(4*c - x^2), x], x, (b + 2*c*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a 
, b, c}, x]
 

rule 1225
Int[((d_.) + (e_.)*(x_))*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*( 
x_)^2)^(p_), x_Symbol] :> Simp[(-(b*e*g*(p + 2) - c*(e*f + d*g)*(2*p + 3) - 
 2*c*e*g*(p + 1)*x))*((a + b*x + c*x^2)^(p + 1)/(2*c^2*(p + 1)*(2*p + 3))), 
 x] + Simp[(b^2*e*g*(p + 2) - 2*a*c*e*g + c*(2*c*d*f - b*(e*f + d*g))*(2*p 
+ 3))/(2*c^2*(2*p + 3))   Int[(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c 
, d, e, f, g, p}, x] &&  !LeQ[p, -1]
 

rule 1236
Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c 
_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[g*(d + e*x)^m*((a + b*x + c*x^2)^(p + 
1)/(c*(m + 2*p + 2))), x] + Simp[1/(c*(m + 2*p + 2))   Int[(d + e*x)^(m - 1 
)*(a + b*x + c*x^2)^p*Simp[m*(c*d*f - a*e*g) + d*(2*c*f - b*g)*(p + 1) + (m 
*(c*e*f + c*d*g - b*e*g) + e*(p + 1)*(2*c*f - b*g))*x, x], x], x] /; FreeQ[ 
{a, b, c, d, e, f, g, p}, x] && GtQ[m, 0] && NeQ[m + 2*p + 2, 0] && (Intege 
rQ[m] || IntegerQ[p] || IntegersQ[2*m, 2*p]) &&  !(IGtQ[m, 0] && EqQ[f, 0])
 

rule 2184
Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p 
_), x_Symbol] :> With[{q = Expon[Pq, x], f = Coeff[Pq, x, Expon[Pq, x]]}, S 
imp[f*(d + e*x)^(m + q - 1)*((a + b*x + c*x^2)^(p + 1)/(c*e^(q - 1)*(m + q 
+ 2*p + 1))), x] + Simp[1/(c*e^q*(m + q + 2*p + 1))   Int[(d + e*x)^m*(a + 
b*x + c*x^2)^p*ExpandToSum[c*e^q*(m + q + 2*p + 1)*Pq - c*f*(m + q + 2*p + 
1)*(d + e*x)^q - f*(d + e*x)^(q - 2)*(b*d*e*(p + 1) + a*e^2*(m + q - 1) - c 
*d^2*(m + q + 2*p + 1) - e*(2*c*d - b*e)*(m + q + p)*x), x], x], x] /; GtQ[ 
q, 1] && NeQ[m + q + 2*p + 1, 0]] /; FreeQ[{a, b, c, d, e, m, p}, x] && Pol 
yQ[Pq, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] &&  !(IGt 
Q[m, 0] && RationalQ[a, b, c, d, e] && (IntegerQ[p] || ILtQ[p + 1/2, 0]))
 
3.3.27.4 Maple [A] (verified)

Time = 0.90 (sec) , antiderivative size = 437, normalized size of antiderivative = 1.04

method result size
risch \(\frac {\left (48 f \,h^{2} c^{3} x^{3}-56 b \,c^{2} f \,h^{2} x^{2}+64 c^{3} e \,h^{2} x^{2}+128 c^{3} f g h \,x^{2}-72 a \,c^{2} f \,h^{2} x +70 b^{2} c f \,h^{2} x -80 b \,c^{2} e \,h^{2} x -160 b \,c^{2} f g h x +96 c^{3} d \,h^{2} x +192 c^{3} e g h x +96 c^{3} f \,g^{2} x +220 a b c f \,h^{2}-128 a \,c^{2} e \,h^{2}-256 a \,c^{2} f g h -105 b^{3} f \,h^{2}+120 b^{2} c e \,h^{2}+240 b^{2} c f g h -144 b \,c^{2} d \,h^{2}-288 b \,c^{2} e g h -144 b \,c^{2} f \,g^{2}+384 c^{3} d g h +192 c^{3} e \,g^{2}\right ) \sqrt {c \,x^{2}+b x +a}}{192 c^{4}}+\frac {\left (48 a^{2} c^{2} f \,h^{2}-120 a \,b^{2} c f \,h^{2}+96 a b \,c^{2} e \,h^{2}+192 a b \,c^{2} f g h -64 a \,c^{3} d \,h^{2}-128 a \,c^{3} e g h -64 a \,c^{3} f \,g^{2}+35 b^{4} f \,h^{2}-40 b^{3} c e \,h^{2}-80 b^{3} c f g h +48 b^{2} c^{2} d \,h^{2}+96 b^{2} c^{2} e g h +48 b^{2} c^{2} f \,g^{2}-128 b \,c^{3} d g h -64 b \,c^{3} e \,g^{2}+128 c^{4} d \,g^{2}\right ) \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{128 c^{\frac {9}{2}}}\) \(437\)
default \(\frac {d \,g^{2} \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{\sqrt {c}}+f \,h^{2} \left (\frac {x^{3} \sqrt {c \,x^{2}+b x +a}}{4 c}-\frac {7 b \left (\frac {x^{2} \sqrt {c \,x^{2}+b x +a}}{3 c}-\frac {5 b \left (\frac {x \sqrt {c \,x^{2}+b x +a}}{2 c}-\frac {3 b \left (\frac {\sqrt {c \,x^{2}+b x +a}}{c}-\frac {b \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 c^{\frac {3}{2}}}\right )}{4 c}-\frac {a \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 c^{\frac {3}{2}}}\right )}{6 c}-\frac {2 a \left (\frac {\sqrt {c \,x^{2}+b x +a}}{c}-\frac {b \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 c^{\frac {3}{2}}}\right )}{3 c}\right )}{8 c}-\frac {3 a \left (\frac {x \sqrt {c \,x^{2}+b x +a}}{2 c}-\frac {3 b \left (\frac {\sqrt {c \,x^{2}+b x +a}}{c}-\frac {b \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 c^{\frac {3}{2}}}\right )}{4 c}-\frac {a \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 c^{\frac {3}{2}}}\right )}{4 c}\right )+\left (e \,h^{2}+2 f g h \right ) \left (\frac {x^{2} \sqrt {c \,x^{2}+b x +a}}{3 c}-\frac {5 b \left (\frac {x \sqrt {c \,x^{2}+b x +a}}{2 c}-\frac {3 b \left (\frac {\sqrt {c \,x^{2}+b x +a}}{c}-\frac {b \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 c^{\frac {3}{2}}}\right )}{4 c}-\frac {a \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 c^{\frac {3}{2}}}\right )}{6 c}-\frac {2 a \left (\frac {\sqrt {c \,x^{2}+b x +a}}{c}-\frac {b \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 c^{\frac {3}{2}}}\right )}{3 c}\right )+\left (2 d g h +g^{2} e \right ) \left (\frac {\sqrt {c \,x^{2}+b x +a}}{c}-\frac {b \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 c^{\frac {3}{2}}}\right )+\left (d \,h^{2}+2 e g h +f \,g^{2}\right ) \left (\frac {x \sqrt {c \,x^{2}+b x +a}}{2 c}-\frac {3 b \left (\frac {\sqrt {c \,x^{2}+b x +a}}{c}-\frac {b \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 c^{\frac {3}{2}}}\right )}{4 c}-\frac {a \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 c^{\frac {3}{2}}}\right )\) \(740\)

input
int((h*x+g)^2*(f*x^2+e*x+d)/(c*x^2+b*x+a)^(1/2),x,method=_RETURNVERBOSE)
 
output
1/192*(48*c^3*f*h^2*x^3-56*b*c^2*f*h^2*x^2+64*c^3*e*h^2*x^2+128*c^3*f*g*h* 
x^2-72*a*c^2*f*h^2*x+70*b^2*c*f*h^2*x-80*b*c^2*e*h^2*x-160*b*c^2*f*g*h*x+9 
6*c^3*d*h^2*x+192*c^3*e*g*h*x+96*c^3*f*g^2*x+220*a*b*c*f*h^2-128*a*c^2*e*h 
^2-256*a*c^2*f*g*h-105*b^3*f*h^2+120*b^2*c*e*h^2+240*b^2*c*f*g*h-144*b*c^2 
*d*h^2-288*b*c^2*e*g*h-144*b*c^2*f*g^2+384*c^3*d*g*h+192*c^3*e*g^2)*(c*x^2 
+b*x+a)^(1/2)/c^4+1/128*(48*a^2*c^2*f*h^2-120*a*b^2*c*f*h^2+96*a*b*c^2*e*h 
^2+192*a*b*c^2*f*g*h-64*a*c^3*d*h^2-128*a*c^3*e*g*h-64*a*c^3*f*g^2+35*b^4* 
f*h^2-40*b^3*c*e*h^2-80*b^3*c*f*g*h+48*b^2*c^2*d*h^2+96*b^2*c^2*e*g*h+48*b 
^2*c^2*f*g^2-128*b*c^3*d*g*h-64*b*c^3*e*g^2+128*c^4*d*g^2)/c^(9/2)*ln((1/2 
*b+c*x)/c^(1/2)+(c*x^2+b*x+a)^(1/2))
 
3.3.27.5 Fricas [A] (verification not implemented)

Time = 0.36 (sec) , antiderivative size = 861, normalized size of antiderivative = 2.05 \[ \int \frac {(g+h x)^2 \left (d+e x+f x^2\right )}{\sqrt {a+b x+c x^2}} \, dx=\left [\frac {3 \, {\left (16 \, {\left (8 \, c^{4} d - 4 \, b c^{3} e + {\left (3 \, b^{2} c^{2} - 4 \, a c^{3}\right )} f\right )} g^{2} - 16 \, {\left (8 \, b c^{3} d - 2 \, {\left (3 \, b^{2} c^{2} - 4 \, a c^{3}\right )} e + {\left (5 \, b^{3} c - 12 \, a b c^{2}\right )} f\right )} g h + {\left (16 \, {\left (3 \, b^{2} c^{2} - 4 \, a c^{3}\right )} d - 8 \, {\left (5 \, b^{3} c - 12 \, a b c^{2}\right )} e + {\left (35 \, b^{4} - 120 \, a b^{2} c + 48 \, a^{2} c^{2}\right )} f\right )} h^{2}\right )} \sqrt {c} \log \left (-8 \, c^{2} x^{2} - 8 \, b c x - b^{2} - 4 \, \sqrt {c x^{2} + b x + a} {\left (2 \, c x + b\right )} \sqrt {c} - 4 \, a c\right ) + 4 \, {\left (48 \, c^{4} f h^{2} x^{3} + 48 \, {\left (4 \, c^{4} e - 3 \, b c^{3} f\right )} g^{2} + 16 \, {\left (24 \, c^{4} d - 18 \, b c^{3} e + {\left (15 \, b^{2} c^{2} - 16 \, a c^{3}\right )} f\right )} g h - {\left (144 \, b c^{3} d - 8 \, {\left (15 \, b^{2} c^{2} - 16 \, a c^{3}\right )} e + 5 \, {\left (21 \, b^{3} c - 44 \, a b c^{2}\right )} f\right )} h^{2} + 8 \, {\left (16 \, c^{4} f g h + {\left (8 \, c^{4} e - 7 \, b c^{3} f\right )} h^{2}\right )} x^{2} + 2 \, {\left (48 \, c^{4} f g^{2} + 16 \, {\left (6 \, c^{4} e - 5 \, b c^{3} f\right )} g h + {\left (48 \, c^{4} d - 40 \, b c^{3} e + {\left (35 \, b^{2} c^{2} - 36 \, a c^{3}\right )} f\right )} h^{2}\right )} x\right )} \sqrt {c x^{2} + b x + a}}{768 \, c^{5}}, -\frac {3 \, {\left (16 \, {\left (8 \, c^{4} d - 4 \, b c^{3} e + {\left (3 \, b^{2} c^{2} - 4 \, a c^{3}\right )} f\right )} g^{2} - 16 \, {\left (8 \, b c^{3} d - 2 \, {\left (3 \, b^{2} c^{2} - 4 \, a c^{3}\right )} e + {\left (5 \, b^{3} c - 12 \, a b c^{2}\right )} f\right )} g h + {\left (16 \, {\left (3 \, b^{2} c^{2} - 4 \, a c^{3}\right )} d - 8 \, {\left (5 \, b^{3} c - 12 \, a b c^{2}\right )} e + {\left (35 \, b^{4} - 120 \, a b^{2} c + 48 \, a^{2} c^{2}\right )} f\right )} h^{2}\right )} \sqrt {-c} \arctan \left (\frac {\sqrt {c x^{2} + b x + a} {\left (2 \, c x + b\right )} \sqrt {-c}}{2 \, {\left (c^{2} x^{2} + b c x + a c\right )}}\right ) - 2 \, {\left (48 \, c^{4} f h^{2} x^{3} + 48 \, {\left (4 \, c^{4} e - 3 \, b c^{3} f\right )} g^{2} + 16 \, {\left (24 \, c^{4} d - 18 \, b c^{3} e + {\left (15 \, b^{2} c^{2} - 16 \, a c^{3}\right )} f\right )} g h - {\left (144 \, b c^{3} d - 8 \, {\left (15 \, b^{2} c^{2} - 16 \, a c^{3}\right )} e + 5 \, {\left (21 \, b^{3} c - 44 \, a b c^{2}\right )} f\right )} h^{2} + 8 \, {\left (16 \, c^{4} f g h + {\left (8 \, c^{4} e - 7 \, b c^{3} f\right )} h^{2}\right )} x^{2} + 2 \, {\left (48 \, c^{4} f g^{2} + 16 \, {\left (6 \, c^{4} e - 5 \, b c^{3} f\right )} g h + {\left (48 \, c^{4} d - 40 \, b c^{3} e + {\left (35 \, b^{2} c^{2} - 36 \, a c^{3}\right )} f\right )} h^{2}\right )} x\right )} \sqrt {c x^{2} + b x + a}}{384 \, c^{5}}\right ] \]

input
integrate((h*x+g)^2*(f*x^2+e*x+d)/(c*x^2+b*x+a)^(1/2),x, algorithm="fricas 
")
 
output
[1/768*(3*(16*(8*c^4*d - 4*b*c^3*e + (3*b^2*c^2 - 4*a*c^3)*f)*g^2 - 16*(8* 
b*c^3*d - 2*(3*b^2*c^2 - 4*a*c^3)*e + (5*b^3*c - 12*a*b*c^2)*f)*g*h + (16* 
(3*b^2*c^2 - 4*a*c^3)*d - 8*(5*b^3*c - 12*a*b*c^2)*e + (35*b^4 - 120*a*b^2 
*c + 48*a^2*c^2)*f)*h^2)*sqrt(c)*log(-8*c^2*x^2 - 8*b*c*x - b^2 - 4*sqrt(c 
*x^2 + b*x + a)*(2*c*x + b)*sqrt(c) - 4*a*c) + 4*(48*c^4*f*h^2*x^3 + 48*(4 
*c^4*e - 3*b*c^3*f)*g^2 + 16*(24*c^4*d - 18*b*c^3*e + (15*b^2*c^2 - 16*a*c 
^3)*f)*g*h - (144*b*c^3*d - 8*(15*b^2*c^2 - 16*a*c^3)*e + 5*(21*b^3*c - 44 
*a*b*c^2)*f)*h^2 + 8*(16*c^4*f*g*h + (8*c^4*e - 7*b*c^3*f)*h^2)*x^2 + 2*(4 
8*c^4*f*g^2 + 16*(6*c^4*e - 5*b*c^3*f)*g*h + (48*c^4*d - 40*b*c^3*e + (35* 
b^2*c^2 - 36*a*c^3)*f)*h^2)*x)*sqrt(c*x^2 + b*x + a))/c^5, -1/384*(3*(16*( 
8*c^4*d - 4*b*c^3*e + (3*b^2*c^2 - 4*a*c^3)*f)*g^2 - 16*(8*b*c^3*d - 2*(3* 
b^2*c^2 - 4*a*c^3)*e + (5*b^3*c - 12*a*b*c^2)*f)*g*h + (16*(3*b^2*c^2 - 4* 
a*c^3)*d - 8*(5*b^3*c - 12*a*b*c^2)*e + (35*b^4 - 120*a*b^2*c + 48*a^2*c^2 
)*f)*h^2)*sqrt(-c)*arctan(1/2*sqrt(c*x^2 + b*x + a)*(2*c*x + b)*sqrt(-c)/( 
c^2*x^2 + b*c*x + a*c)) - 2*(48*c^4*f*h^2*x^3 + 48*(4*c^4*e - 3*b*c^3*f)*g 
^2 + 16*(24*c^4*d - 18*b*c^3*e + (15*b^2*c^2 - 16*a*c^3)*f)*g*h - (144*b*c 
^3*d - 8*(15*b^2*c^2 - 16*a*c^3)*e + 5*(21*b^3*c - 44*a*b*c^2)*f)*h^2 + 8* 
(16*c^4*f*g*h + (8*c^4*e - 7*b*c^3*f)*h^2)*x^2 + 2*(48*c^4*f*g^2 + 16*(6*c 
^4*e - 5*b*c^3*f)*g*h + (48*c^4*d - 40*b*c^3*e + (35*b^2*c^2 - 36*a*c^3)*f 
)*h^2)*x)*sqrt(c*x^2 + b*x + a))/c^5]
 
3.3.27.6 Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 910 vs. \(2 (432) = 864\).

Time = 1.10 (sec) , antiderivative size = 910, normalized size of antiderivative = 2.17 \[ \int \frac {(g+h x)^2 \left (d+e x+f x^2\right )}{\sqrt {a+b x+c x^2}} \, dx=\begin {cases} \sqrt {a + b x + c x^{2}} \left (\frac {f h^{2} x^{3}}{4 c} + \frac {x^{2} \left (- \frac {7 b f h^{2}}{8 c} + e h^{2} + 2 f g h\right )}{3 c} + \frac {x \left (- \frac {3 a f h^{2}}{4 c} - \frac {5 b \left (- \frac {7 b f h^{2}}{8 c} + e h^{2} + 2 f g h\right )}{6 c} + d h^{2} + 2 e g h + f g^{2}\right )}{2 c} + \frac {- \frac {2 a \left (- \frac {7 b f h^{2}}{8 c} + e h^{2} + 2 f g h\right )}{3 c} - \frac {3 b \left (- \frac {3 a f h^{2}}{4 c} - \frac {5 b \left (- \frac {7 b f h^{2}}{8 c} + e h^{2} + 2 f g h\right )}{6 c} + d h^{2} + 2 e g h + f g^{2}\right )}{4 c} + 2 d g h + e g^{2}}{c}\right ) + \left (- \frac {a \left (- \frac {3 a f h^{2}}{4 c} - \frac {5 b \left (- \frac {7 b f h^{2}}{8 c} + e h^{2} + 2 f g h\right )}{6 c} + d h^{2} + 2 e g h + f g^{2}\right )}{2 c} - \frac {b \left (- \frac {2 a \left (- \frac {7 b f h^{2}}{8 c} + e h^{2} + 2 f g h\right )}{3 c} - \frac {3 b \left (- \frac {3 a f h^{2}}{4 c} - \frac {5 b \left (- \frac {7 b f h^{2}}{8 c} + e h^{2} + 2 f g h\right )}{6 c} + d h^{2} + 2 e g h + f g^{2}\right )}{4 c} + 2 d g h + e g^{2}\right )}{2 c} + d g^{2}\right ) \left (\begin {cases} \frac {\log {\left (b + 2 \sqrt {c} \sqrt {a + b x + c x^{2}} + 2 c x \right )}}{\sqrt {c}} & \text {for}\: a - \frac {b^{2}}{4 c} \neq 0 \\\frac {\left (\frac {b}{2 c} + x\right ) \log {\left (\frac {b}{2 c} + x \right )}}{\sqrt {c \left (\frac {b}{2 c} + x\right )^{2}}} & \text {otherwise} \end {cases}\right ) & \text {for}\: c \neq 0 \\\frac {2 \left (\frac {f h^{2} \left (a + b x\right )^{\frac {9}{2}}}{9 b^{4}} + \frac {\left (a + b x\right )^{\frac {7}{2}} \left (- 4 a f h^{2} + b e h^{2} + 2 b f g h\right )}{7 b^{4}} + \frac {\left (a + b x\right )^{\frac {5}{2}} \cdot \left (6 a^{2} f h^{2} - 3 a b e h^{2} - 6 a b f g h + b^{2} d h^{2} + 2 b^{2} e g h + b^{2} f g^{2}\right )}{5 b^{4}} + \frac {\left (a + b x\right )^{\frac {3}{2}} \left (- 4 a^{3} f h^{2} + 3 a^{2} b e h^{2} + 6 a^{2} b f g h - 2 a b^{2} d h^{2} - 4 a b^{2} e g h - 2 a b^{2} f g^{2} + 2 b^{3} d g h + b^{3} e g^{2}\right )}{3 b^{4}} + \frac {\sqrt {a + b x} \left (a^{4} f h^{2} - a^{3} b e h^{2} - 2 a^{3} b f g h + a^{2} b^{2} d h^{2} + 2 a^{2} b^{2} e g h + a^{2} b^{2} f g^{2} - 2 a b^{3} d g h - a b^{3} e g^{2} + b^{4} d g^{2}\right )}{b^{4}}\right )}{b} & \text {for}\: b \neq 0 \\\frac {d g^{2} x + \frac {f h^{2} x^{5}}{5} + \frac {x^{4} \left (e h^{2} + 2 f g h\right )}{4} + \frac {x^{3} \left (d h^{2} + 2 e g h + f g^{2}\right )}{3} + \frac {x^{2} \cdot \left (2 d g h + e g^{2}\right )}{2}}{\sqrt {a}} & \text {otherwise} \end {cases} \]

input
integrate((h*x+g)**2*(f*x**2+e*x+d)/(c*x**2+b*x+a)**(1/2),x)
 
output
Piecewise((sqrt(a + b*x + c*x**2)*(f*h**2*x**3/(4*c) + x**2*(-7*b*f*h**2/( 
8*c) + e*h**2 + 2*f*g*h)/(3*c) + x*(-3*a*f*h**2/(4*c) - 5*b*(-7*b*f*h**2/( 
8*c) + e*h**2 + 2*f*g*h)/(6*c) + d*h**2 + 2*e*g*h + f*g**2)/(2*c) + (-2*a* 
(-7*b*f*h**2/(8*c) + e*h**2 + 2*f*g*h)/(3*c) - 3*b*(-3*a*f*h**2/(4*c) - 5* 
b*(-7*b*f*h**2/(8*c) + e*h**2 + 2*f*g*h)/(6*c) + d*h**2 + 2*e*g*h + f*g**2 
)/(4*c) + 2*d*g*h + e*g**2)/c) + (-a*(-3*a*f*h**2/(4*c) - 5*b*(-7*b*f*h**2 
/(8*c) + e*h**2 + 2*f*g*h)/(6*c) + d*h**2 + 2*e*g*h + f*g**2)/(2*c) - b*(- 
2*a*(-7*b*f*h**2/(8*c) + e*h**2 + 2*f*g*h)/(3*c) - 3*b*(-3*a*f*h**2/(4*c) 
- 5*b*(-7*b*f*h**2/(8*c) + e*h**2 + 2*f*g*h)/(6*c) + d*h**2 + 2*e*g*h + f* 
g**2)/(4*c) + 2*d*g*h + e*g**2)/(2*c) + d*g**2)*Piecewise((log(b + 2*sqrt( 
c)*sqrt(a + b*x + c*x**2) + 2*c*x)/sqrt(c), Ne(a - b**2/(4*c), 0)), ((b/(2 
*c) + x)*log(b/(2*c) + x)/sqrt(c*(b/(2*c) + x)**2), True)), Ne(c, 0)), (2* 
(f*h**2*(a + b*x)**(9/2)/(9*b**4) + (a + b*x)**(7/2)*(-4*a*f*h**2 + b*e*h* 
*2 + 2*b*f*g*h)/(7*b**4) + (a + b*x)**(5/2)*(6*a**2*f*h**2 - 3*a*b*e*h**2 
- 6*a*b*f*g*h + b**2*d*h**2 + 2*b**2*e*g*h + b**2*f*g**2)/(5*b**4) + (a + 
b*x)**(3/2)*(-4*a**3*f*h**2 + 3*a**2*b*e*h**2 + 6*a**2*b*f*g*h - 2*a*b**2* 
d*h**2 - 4*a*b**2*e*g*h - 2*a*b**2*f*g**2 + 2*b**3*d*g*h + b**3*e*g**2)/(3 
*b**4) + sqrt(a + b*x)*(a**4*f*h**2 - a**3*b*e*h**2 - 2*a**3*b*f*g*h + a** 
2*b**2*d*h**2 + 2*a**2*b**2*e*g*h + a**2*b**2*f*g**2 - 2*a*b**3*d*g*h - a* 
b**3*e*g**2 + b**4*d*g**2)/b**4)/b, Ne(b, 0)), ((d*g**2*x + f*h**2*x**5...
 
3.3.27.7 Maxima [F(-2)]

Exception generated. \[ \int \frac {(g+h x)^2 \left (d+e x+f x^2\right )}{\sqrt {a+b x+c x^2}} \, dx=\text {Exception raised: ValueError} \]

input
integrate((h*x+g)^2*(f*x^2+e*x+d)/(c*x^2+b*x+a)^(1/2),x, algorithm="maxima 
")
 
output
Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(4*a*c-b^2>0)', see `assume?` for 
 more deta
 
3.3.27.8 Giac [A] (verification not implemented)

Time = 0.31 (sec) , antiderivative size = 442, normalized size of antiderivative = 1.05 \[ \int \frac {(g+h x)^2 \left (d+e x+f x^2\right )}{\sqrt {a+b x+c x^2}} \, dx=\frac {1}{192} \, \sqrt {c x^{2} + b x + a} {\left (2 \, {\left (4 \, {\left (\frac {6 \, f h^{2} x}{c} + \frac {16 \, c^{3} f g h + 8 \, c^{3} e h^{2} - 7 \, b c^{2} f h^{2}}{c^{4}}\right )} x + \frac {48 \, c^{3} f g^{2} + 96 \, c^{3} e g h - 80 \, b c^{2} f g h + 48 \, c^{3} d h^{2} - 40 \, b c^{2} e h^{2} + 35 \, b^{2} c f h^{2} - 36 \, a c^{2} f h^{2}}{c^{4}}\right )} x + \frac {192 \, c^{3} e g^{2} - 144 \, b c^{2} f g^{2} + 384 \, c^{3} d g h - 288 \, b c^{2} e g h + 240 \, b^{2} c f g h - 256 \, a c^{2} f g h - 144 \, b c^{2} d h^{2} + 120 \, b^{2} c e h^{2} - 128 \, a c^{2} e h^{2} - 105 \, b^{3} f h^{2} + 220 \, a b c f h^{2}}{c^{4}}\right )} - \frac {{\left (128 \, c^{4} d g^{2} - 64 \, b c^{3} e g^{2} + 48 \, b^{2} c^{2} f g^{2} - 64 \, a c^{3} f g^{2} - 128 \, b c^{3} d g h + 96 \, b^{2} c^{2} e g h - 128 \, a c^{3} e g h - 80 \, b^{3} c f g h + 192 \, a b c^{2} f g h + 48 \, b^{2} c^{2} d h^{2} - 64 \, a c^{3} d h^{2} - 40 \, b^{3} c e h^{2} + 96 \, a b c^{2} e h^{2} + 35 \, b^{4} f h^{2} - 120 \, a b^{2} c f h^{2} + 48 \, a^{2} c^{2} f h^{2}\right )} \log \left ({\left | 2 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )} \sqrt {c} + b \right |}\right )}{128 \, c^{\frac {9}{2}}} \]

input
integrate((h*x+g)^2*(f*x^2+e*x+d)/(c*x^2+b*x+a)^(1/2),x, algorithm="giac")
 
output
1/192*sqrt(c*x^2 + b*x + a)*(2*(4*(6*f*h^2*x/c + (16*c^3*f*g*h + 8*c^3*e*h 
^2 - 7*b*c^2*f*h^2)/c^4)*x + (48*c^3*f*g^2 + 96*c^3*e*g*h - 80*b*c^2*f*g*h 
 + 48*c^3*d*h^2 - 40*b*c^2*e*h^2 + 35*b^2*c*f*h^2 - 36*a*c^2*f*h^2)/c^4)*x 
 + (192*c^3*e*g^2 - 144*b*c^2*f*g^2 + 384*c^3*d*g*h - 288*b*c^2*e*g*h + 24 
0*b^2*c*f*g*h - 256*a*c^2*f*g*h - 144*b*c^2*d*h^2 + 120*b^2*c*e*h^2 - 128* 
a*c^2*e*h^2 - 105*b^3*f*h^2 + 220*a*b*c*f*h^2)/c^4) - 1/128*(128*c^4*d*g^2 
 - 64*b*c^3*e*g^2 + 48*b^2*c^2*f*g^2 - 64*a*c^3*f*g^2 - 128*b*c^3*d*g*h + 
96*b^2*c^2*e*g*h - 128*a*c^3*e*g*h - 80*b^3*c*f*g*h + 192*a*b*c^2*f*g*h + 
48*b^2*c^2*d*h^2 - 64*a*c^3*d*h^2 - 40*b^3*c*e*h^2 + 96*a*b*c^2*e*h^2 + 35 
*b^4*f*h^2 - 120*a*b^2*c*f*h^2 + 48*a^2*c^2*f*h^2)*log(abs(2*(sqrt(c)*x - 
sqrt(c*x^2 + b*x + a))*sqrt(c) + b))/c^(9/2)
 
3.3.27.9 Mupad [F(-1)]

Timed out. \[ \int \frac {(g+h x)^2 \left (d+e x+f x^2\right )}{\sqrt {a+b x+c x^2}} \, dx=\int \frac {{\left (g+h\,x\right )}^2\,\left (f\,x^2+e\,x+d\right )}{\sqrt {c\,x^2+b\,x+a}} \,d x \]

input
int(((g + h*x)^2*(d + e*x + f*x^2))/(a + b*x + c*x^2)^(1/2),x)
 
output
int(((g + h*x)^2*(d + e*x + f*x^2))/(a + b*x + c*x^2)^(1/2), x)